package com.example.myretrofit2;

import android.os.Parcel;
import android.os.Parcelable;

import java.io.Serializable;
import java.util.List;

public class Goods extends Page implements Parcelable {
    private int id;
    private int categoryid;
    private int userid;
    private String goodname;
    private float price;
    private String src;
    private int xp;
    private int status;
    private String orderType;
    private int newgoods;
    private List<GoodsInfo>  goodsinfos;
    public Goods(){

    }

    public Goods(Parcel in) {
        id = in.readInt();
        categoryid = in.readInt();
        userid = in.readInt();
        goodname = in.readString();
        price = in.readFloat();
        src = in.readString();
        xp = in.readInt();
        status = in.readInt();
        orderType = in.readString();
        newgoods = in.readInt();
    }

    public static final Creator<Goods> CREATOR = new Creator<Goods>() {
        @Override
        public Goods createFromParcel(Parcel in) {
            return new Goods(in);
        }

        @Override
        public Goods[] newArray(int size) {
            return new Goods[size];
        }
    };

    public List<GoodsInfo> getGoodsinfos() {
        return goodsinfos;
    }

    public void setGoodsinfos(List<GoodsInfo> goodsinfos) {
        this.goodsinfos = goodsinfos;
    }

    public int getNewgoods() {
        return newgoods;
    }

    public void setNewgoods(int newgoods) {
        this.newgoods = newgoods;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getCategoryid() {
        return categoryid;
    }

    public void setCategoryid(int categoryid) {
        this.categoryid = categoryid;
    }

    public int getUserid() {
        return userid;
    }

    public void setUserid(int userid) {
        this.userid = userid;
    }

    public String getGoodname() {
        return goodname;
    }

    public void setGoodname(String goodname) {
        this.goodname = goodname;
    }

    public float getPrice() {
        return price;
    }

    public void setPrice(float price) {
        this.price = price;
    }

    public String getSrc() {
        return src;
    }

    public void setSrc(String src) {
        this.src = src;
    }

    public int getXp() {
        return xp;
    }

    public void setXp(int xp) {
        this.xp = xp;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getOrderType() {
        return orderType;
    }

    public void setOrderType(String orderType) {
        this.orderType = orderType;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeInt(id);
        parcel.writeInt(categoryid);
        parcel.writeInt(userid);
        parcel.writeString(goodname);
        parcel.writeFloat(price);
        parcel.writeString(src);
        parcel.writeInt(xp);
        parcel.writeInt(status);
        parcel.writeString(orderType);
        parcel.writeInt(newgoods);
    }
}
